<?
/**
* Copyright (c) 2002-2007 BioWare Corp.
* http://www.bigdaddymonitor.org
*
* This file is part of the BigDaddy Monitoring
* program. It is free software distributed under
* the terms of the BSD License. It is ditributed
* in the hopes that it will be useful, but
* WITHOUT ANY WARRANTY; without event the implied
* warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE.
*
* The BSD License is available from:
* http://www.opensource.org/licenses/bsd-license.php
**/
?>
<div class="wiki_simpleform_padding">
<?
if ($displayParams["aFormDisplay"]["bShowFormTag"])
{

    ?>
    <form  action="<?=$displayParams["aFormDisplay"]["action"];?>" method="<?=$displayParams["aFormDisplay"]["method"];?>" name="<?=$displayParams["aFormDisplay"]["sFormName"];?>">
	
	<?

        echo $displayParams["aSearchPage"]["sInstructions"];
        
        include("form.php");
        ?><br><br><?
        include("button.php");
        
        
        if ($displayParams["aSearchPage"]["bShowResults"] && !$displayParams["aSearchPage"]["bNoResults"])
        {
            ?>
            <div style="border-top: 1px dashed #ccc;" align="center"> 
                <?=$displayParams["aSearchPage"]["sPageNumbers"];?>
                <br>
                <?=$displayParams["aSearchPage"]["sSearchFound"];?>

            </div>

            <dl>            
            <?
            
            for ($i=0; $i<count($displayParams["aSearchPage"]["aResult"]); $i++)
            {
                $sURL=$_SERVER["PHP_SELF"]."?action=view&wiki=".$displayParams["aSearchPage"]["aResult"][$i]["wiki"]."&page=".$displayParams["aSearchPage"]["aResult"][$i]["page"];
                
                ?>
                <dt><b><a href="<?=$sURL;?>"><?=$displayParams["aSearchPage"]["aResult"][$i]["page"];?></a></b> (<?=$displayParams["aSearchPage"]["aResult"][$i]["sWikiTitle"];?>)</dt>
                <dd style="margin-bottom: 10px;"><span class="smallfont"><?=$displayParams["aSearchPage"]["aResult"][$i]["sBody"];?>...</span></dd>
                <?
            }
            ?>
            </dl>
            
            <div style="border-bottom: 1px dashed #ccc;" align="center"> 
                <?=$displayParams["aSearchPage"]["sPageNumbers"];?>
            </div>
            
            <?
            
        }
        elseif ($displayParams["aSearchPage"]["bNoResults"])
        {
           ?>
            <div style="border-top: 1px dashed #ccc; border-bottom: 1px dashed #ccc; padding-top: 5px; padding-bottom: 5px;" align="center"> 
                Your search brought back no results. Try again.
            </div>
            <?
            
            
        }
        ?>
    <input type="submit" value="Search">
    </form>
    <?
}
?>

</div>
